<template>
    <el-select :value="value" placeholder="请选择活动区域" @change="change" clearable>
      <el-option v-for="item in channels" :key="item.id" :label="item.name" :value="item.id"></el-option>
    </el-select>
</template>

<script>
import { getChannelList } from '@/api/article'
export default {
  props: ['value'],
  data () {
    return {
      channels: []
    }
  },
  async created () {
    const res = await getChannelList()
    if (res.status === 200) {
      this.channels = res.data.data.channels
    }
  },
  methods: {
    change (val) {
      this.$emit('input', val)
    }
  }
}
</script>
